﻿using UnityEngine;
using System.Collections;
using ProtoBuf.Message;

namespace UI
{
    public class UIUnionFightPlayerItem : MonoBehaviour
    {
        public UILabel playerName;
        public UILabel score;
        public HeroIcon icon;
        public void SetPlayerItem(UFFightResultPlayer player)
        {
            var unions = UIUnionFightRunMap.GetNetData().netBattle.unionInfos;
            foreach (var union in unions)
            {
              if(player.unionId == union.unionId)
                    playerName.text = string.Format(TableTextBlo.GetText("union_fight_name"), union.serverId, player.nickName);
            }
            score.text = player.value + "";
            icon.SetHeroWithId(player.mainHeroId);
        }
    }
}

